#pragma once
#include "ITerrain.h"
#include "OgreImage.h"

struct STileTex
{
	int iLow;
	int iOpt;
	int iHigh;

	STileTex():iLow(0),iOpt(0),iHigh(0)
	{

	}
};

class TexMgr_Ogre : public ITexMgr
{
	static const std::string ResGrpName;

public:
	TexMgr_Ogre(void);
	~TexMgr_Ogre(void);
	virtual bool LoadImg(const char* fileName);
	virtual bool SaveImg(const char* fileName);
	virtual void GetColorValueAt(int iX, int iZ, float fHeight, int texIdx, float& r, float& g, float& b, float& a);
	virtual int GetImgCnt();
	virtual void* GenerateTexture(int iResolution, ITerrain* parent);
private:
	void CalcTileDat();
	void Clear();
	void GetTexCoord(int& ix, int& iz, int TexId);
private:
	std::vector<Ogre::Image*> m_VecImg;
	STileTex* m_pTileTexInfo;
};

